package main

import (
	"01/likou"
	"fmt"
)

// slice 增加 和 修改元素 函数内测试
func ce(nums *[]int, num int) {
	// 增加元素
	*nums = append(*nums, num)
	// 修改元素
	(*nums)[1] = 333
}

func shi(nums []int, num int) {
	// 只增加元素，并不需要指针
	nums[0] = 222
}

//func main() {
// 二进制手表
//s := likou.ReadBinaryWatch(2)
//fmt.Println(s)
//fmt.Println(len(s))

//s1 := likou.ReadBinaryWatch1(2)
//fmt.Println(s1)
//fmt.Println(len(s1))

//var nums = []int{1, 2, 3}
//ce(&nums, 2)
//fmt.Println(nums)

//shi(nums, 45)
//fmt.Println(nums)

//var a [][]string
//a = [][]string{[]string{"abc", "efg"}, []string{"abc", "mln"}}
//fmt.Println(a)

//b = make([][]string, 0)
//b := []int {1, 2, 3, 4, 5}
//fmt.Println("1231231231231" - '0')

//rst := likou.SplitIntoFibonacci("123456579")
//fmt.Println(rst)

//var a string
//a = "123我是go初学者"
//aa := []rune(a)
//fmt.Println(len(aa))

//likou.A()

//var k = 9
//for k = range []int{} {fmt.Println(123)}
//fmt.Println(k)
//
//for k = 0; k < 3; k++ {}
//fmt.Println(k)

//var b *[3]int

//for k, _ = range (*[3]int)(nil) {fmt.Println(456)}
//fmt.Println(k)

//var c = [3]int {1, 2, 3}
//for num, v := range c {
//	fmt.Println(num, v)
//}

//var s = "123"
//fmt.Println(strconv.Atoi(s))
//fmt.Println(strconv.ParseInt(s, 10, 32))
//aaa := []rune(s)
//for _, qq := range s {
//	fmt.Println(qq)
//}

//var a = [...]int {1, 2, 3, 4, 5}
//var b = [...]int {1, 2, 3, 4, 5}
//fmt.Println(a == b)
//fmt.Println(&a == &b)
//fmt.Printf("%d, %d", &a[0], &b[0])

//st := "12345678"
//st = st[:7] + st[8:]
//fmt.Println(st)

//ss := "()())()"
//rst := likou.RemoveInvalidParentheses(ss)
//fmt.Println(rst)

//visited := make(map[string]bool)
//visited[s] = true
//fmt.Println(visited[s])
//fmt.Println(visited["123"])

//getWd, _ := os.Getwd()
//fmt.Println(getWd)
//a := path.Join("123", "456", "789")
//ps := []string {"123", "456", "789"}
//b := strings.Join(ps, "\\")
//pathS := "D:\\123\\456\\789"
//fmt.Println(a)
//fmt.Println(b)
//fmt.Println(pathS)
//
//sep := string(os.PathSeparator)
//fmt.Println(sep)
//maze := [][]string{{".","+","+","+",".",".",".","+","+"}, {".",".","+",".","+",".","+","+","."}, {".",".","+",".",".",".",".",".","."}, {".","+",".",".","+","+",".","+","."}, {".",".",".",".",".",".",".","+","."}, {".",".",".",".",".",".",".",".","."}, {".",".",".","+",".",".",".",".","."}, {".",".",".",".",".",".",".",".","+"}, {"+",".",".",".","+",".",".",".","."}}
//rst := likou.NearestExit(maze, []int{5, 6})
//fmt.Println(rst)
//}

func test(nums []int) {
	// 去掉nums中的一个元素， 这里的nums 相当于原 nums的一个切片
	nums = append(nums[:2], nums[3:]...)
	fmt.Println("test: ", nums)
}

func main() {
	//nums := []int {1, 2, 3, 4, 5}
	//test(nums)
	//fmt.Println("main: ", nums)

	//var s []string
	//count := 111111
	//
	//s = append(s, string(count))
	//fmt.Println(s)
	//
	//rst := []string {"1", "2", "3"}
	//fmt.Println(strings.Join(rst, ","))
	//j := 0
	//j ++
	//fmt.Println(j)

	rst := likou.GetChaoticSequence(3)
	fmt.Println(rst)
	a := 0
	b := 1

	a, b = b, a
	fmt.Println(a, b)
}
